package com.miao.teacher.models;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;

import com.espeaker.sdk.utils.JsonUtils;

public class FeedBack {
	public int feedback_rate;
	public String feedback_msg;
	public String title;

	public int count;
	public float total_rate=0;

	public List<FeedBack> parse(JSONArray jArray) {
		List<FeedBack> mList = new ArrayList<FeedBack>();
		total_rate=0;
		try {
			if (jArray != null) {
				for (int i = 0; i < jArray.length(); i++) {
					FeedBack feed=new FeedBack();
					feed.feedback_msg=JsonUtils.getString(jArray.getJSONObject(i), "feedback_msg");
					feed.title=JsonUtils.getString(jArray.getJSONObject(i), "title");
					feed.feedback_rate=JsonUtils.getInt(jArray.getJSONObject(i), "feedback_rate", 0);
					total_rate+=feed.feedback_rate;
					mList.add(feed);
				}
			}
			count=mList.size();
		} catch (Exception er) {
		}
		return mList;
	}
}
